<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Convert string from one codepage to another</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.php-strip-whitespace.html">« php_strip_whitespace</a></li>
      <li style="float: right;"><a href="function.sapi-windows-cp-get.html">sapi_windows_cp_get »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.misc.html">杂项 函数</a></li>
    <li>Convert string from one codepage to another</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.sapi-windows-cp-conv" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sapi_windows_cp_conv</h1>
  <p class="verinfo">(PHP 7 &gt;= 7.1.0, PHP 8)</p><p class="refpurpose"><span class="refname">sapi_windows_cp_conv</span> &mdash; <span class="dc-title">Convert string from one codepage to another</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sapi-windows-cp-conv-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sapi_windows_cp_conv</strong></span>(<span class="methodparam"><span class="type"><span class="type">int</span>|<span class="type">string</span></span> <code class="parameter">$in_codepage</code></span>, <span class="methodparam"><span class="type"><span class="type">int</span>|<span class="type">string</span></span> <code class="parameter">$out_codepage</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$subject</code></span>): <span class="type"><span class="type">?</span><span class="type">string</span></span></div>

  <p class="para rdfs-comment">
   Convert string from one codepage to another.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sapi-windows-cp-conv-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">in_codepage</code></dt>

    <dd>

     <p class="para">
      The codepage of the <code class="parameter">subject</code> string.
      Either the codepage name or identifier.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">out_codepage</code></dt>

    <dd>

     <p class="para">
      The codepage to convert the <code class="parameter">subject</code> string to.
      Either the codepage name or identifier.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">subject</code></dt>

    <dd>

     <p class="para">
      The string to convert.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sapi-windows-cp-conv-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   The <code class="parameter">subject</code> string converted to
   <code class="parameter">out_codepage</code>, or <strong><code>null</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.sapi-windows-cp-conv-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   This function issues E_WARNING level errors, if invalid codepages are given,
   or if the subject is not valid for <code class="parameter">in_codepage</code>.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.sapi-windows-cp-conv-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="function.sapi-windows-cp-get.html" class="function" rel="rdfs-seeAlso">sapi_windows_cp_get()</a> - Get current codepage</span></li>
   <li class="member"><span class="function"><a href="function.iconv.html" class="function" rel="rdfs-seeAlso">iconv()</a> - 字符串按要求的字符编码来转换</span></li>
  </ul>
 </div>


</div></div></div></body></html>